Term Description: A Simple Powerful Extension to Prolog Data Structures
نویسنده
چکیده
Term description is a simple, powerful extension of terras. For example, functional notation and lazy execution of a program is introduced in a very natural manner without changing the basic mechanism of the computation, such as unification and backtracking. Especially , the readability of functional languages is introduced without actually introducing functional concepts. A term description is an extension to Prolog data structure. A term description is a term with some description (constraints) on it: : It means that must satisfy which is a predicate. In other words, whenever the term is unified with another term, the substitution must satisfy the description. B. Motivation Although unification in Prolog is a useful tool for manipulating structures, it lacks the ability to express complex patterns and operations over them. In Prolog, dividing a list into its first element and the rest, and constructing a list from its first element and the rest are very easy. There is no need to call a procedure to perform the operation. A simple list notation , [Carl Odr] does both of them. However, it is not so easy to divide a list into two lists or construct a single list from two lists. This operation is usually called "append" and requires a special program. Some operations are expressed as patterns and others are expressed as procedures. This destroys the readability and coherence of program notations. The distinction is not the essential part of the programming. The notation is simply a syntax sugar for a term cons(X,Y). We could similarly give a syntax sugar for a term description, : is unified with another term T, is first unified with T and then is checked. A constraint is described as a Prolog program, and executed as if it were written at the top-level. If the execution of the constraint fails, the unification also fails. A constraint is executed only when it is necessary, ie., only when the term description is unified with non-variable terms. When two term descriptions are unified, only one of them is executed first. For example, when two term descriptions: X:p(X,Y) and Z:g(Z) are unified, X is unified with Z:q(Z) first*, and p(Z:q(Z),Y) is executed. Then Z:q(Z) is in turn unified with the first argument of 'p'. A term description may be used to produce a value. The term description is similar to the macro In ESP [Chikayama 83] …
منابع مشابه
ProFIT: Prolog with Features, Inheritance and Templates
ProFIT is an extension of Standard Prolog with Features, Inheritance and Templates. P roFIT Mlows the programmer or grammar developer to declare an inheritance hierarchy, features and templates. Sorted feature terms can be used in ProFIT programs together with Prolog terms to provide a clearer description language for linguistic structures. P roFIT compiles all sorted feature terms into a Prolo...
متن کاملA Temporal Logic for Uncertain Events and An Outline of A Possible Implementation in An Extension of PROLOG
There is uncertainty associated with the occurre nce of many events in real life. In this paper we develop a temporal logic to deal with such uncertain events and outline a possible implementation in an extension of PROLOG. Events are represented as fuzz y sets with the membership function giving the possibility of occurrence of the event in a given interval of time. The developed temporal logi...
متن کاملplspec – A Specification Language for Prolog Data
In general, even though Prolog is a dynamically typed language, predicates may not be called with arbitrarily typed arguments. Assumptions regarding type or mode are often made implicitly, without being directly represented in the source code. This complicates identifying the types or data structures anticipated by predicates. In consequence, Covington et al. proposed that Prolog developers sho...
متن کاملTowards Trusted Semantic Service Computing
This paper describes a new prototype of a semantic Service Oriented Architecture (SOA) called Spec Services. Instead of publishing their API through a protocol like SOAP, as Web Services do, services can register to a service manager a powerful syntactic description or even semantic description of their functional capabilities. The client entity will then send a syntactic or semantic descriptio...
متن کاملStable Isotope Application in Animal Nutrition Science
The application of stable isotope analysis (SIA) has become a standard scientific approach in Agricultural and Ecological researches and, more in general, in several disciplines such as biology, botany, zoology, organic chemistry, climatology, and nutrition. The main objectives of this paper are (1) to provide a simple definition of stable isotopes and (2) to illustrate analytical measurement m...
متن کامل